import service from '../utils/request'

/* export function name(payload = {}) {
    return service.post('/api/', payload)
}
export function name(payload = {}) {
    return service.get('/api/', { params: payload })
} */
// 01. 用户 - 注册
export function user_register(payload = {}) {
    return service.post('/user/register', payload)
}
// 02. 用户 - 登陆
export function user_login(payload = {}) {
    return service.post('/user/login', payload)
}
// 03. 首页 - 轮播图
export function index_banner(payload = {}) {
    return service.get('/index/banner', { params: payload })
}
// 04. 首页 - 导航
export function index_nav(payload = {}) {
    return service.get('/index/nav', { params: payload })
}
// 05. 首页 - 推荐列表
export function index_goodlist(payload = {}) {
    return service.get('/index/goodlist', { params: payload })
}
// 06. 分类 - 一级分类
export function category_list(payload = {}) {
    return service.get('/category/list', { params: payload })
}
// 07. 分类 - 二三级分类
export function category_subcate(payload = {}) {
    return service.get('/category/subcate', { params: payload })
}
// 08. 所有商品 - 按分类搜索
export function good_list(payload = {}) {
    return service.get('/good/list', { params: payload })
}
// 09. 所有商品 - 按关键词搜索
export function good_search(payload = {}) {
    return service.get('/good/search', { params: payload })
}
// 10. 所有商品 - 热门搜索
export function good_hotsearch(payload = {}) {
    return service.get('/good/hotsearch', { params: payload })
}
// 11. 商品 - 详情
export function good_goodinfo(payload = {}) {
    return service.get('/good/goodinfo', { params: payload })
}
// 12. 商品 - 收藏列表
export function good_favlist(payload = {}) {
    return service.get('/good/favlist', { params: payload })
}
// 13. 商品 - 收藏
export function good_fav(payload = {}) {
    return service.post('/good/fav', payload)
}
// 14. 商品 - 取消收藏
export function good_unfav(payload = {}) {
    return service.post('/good/unfav', payload)
}
// 15. 购物车 - 列表
export function shopcart_list(payload = {}) {
    return service.get('/shopcart/list', { params: payload })
}
// 16. 购物车 - 清空
export function shopcart_clear(payload = {}) {
    return service.post('/shopcart/clear', payload)
}
// 17. 购物车 - 数量加1
export function shopcart_add(payload = {}) {
    return service.post('/shopcart/add', payload)
}
// 18. 购物车 - 数量减1
export function shopcart_sub(payload = {}) {
    return service.post('/shopcart/sub', payload)
}